package com.fingard.dsp.bank.reqrespobj.batrecrefund;

import java.text.ParseException;
import java.util.Date;

import com.fingard.constant.Format;
import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RequestBase;
import com.fingard.text.StringHelper;
import com.fingard.xml.XmlTextReader;

public class ReqQryBatRecRefund extends RequestBase {
	public String reqBatchNO;
	public String totalNum;
	public String totalAmt;
	public String bgnDate;
	public String payAct;
	public String payState;

	private XmlTextReader xmlReader;
	
	public ReqQryBatRecRefund(XmlTextReader p_xmlReader, ReqRespHeader p_header) throws Exception{
		init(p_xmlReader, p_header);
	}
	
	public void init(XmlTextReader p_xmlReader, ReqRespHeader p_header) throws Exception{
		reqHeader = p_header;
		xmlReader = p_xmlReader;
		totalNum = xmlReader.getSimpleText("TotalNum");
		totalAmt = xmlReader.getSimpleText("TotalAmt");
		reqBatchNO = xmlReader.getSimpleText("ReqSeqID");
		bgnDate = xmlReader.getSimpleText("BgnDate");
		payAct = xmlReader.getSimpleText("PayAct");
		payState = xmlReader.getSimpleTextNotNull("PayState");
		if(StringHelper.isNullOrEmpty(payState)){
			payState = "5";
		}
	}
	
	public Date getBgnDateTime() throws ParseException{
		return Format.DateTimeFormat.parse(bgnDate);
	}
}
